//
//  TTDianpuImageCollectionViewCell.m
//  TaoTuo
//
//  Created by admin on 2019/11/6.
//  Copyright © 2019 admin. All rights reserved.
//

#import "TTDianpuImageCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@interface TTDianpuImageCollectionViewCell ()

@property (nonatomic, strong) UIImageView *imageView;

@end

@implementation TTDianpuImageCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _imageView = [[UIImageView alloc] initWithFrame:self.bounds];
        _imageView.layer.cornerRadius = 5;
        _imageView.layer.masksToBounds = YES;
        _imageView.contentMode = UIViewContentModeScaleAspectFill;
        [self.contentView addSubview:_imageView];
        
        
    }
    return self;
}

- (void)setUrlString:(NSString *)urlString
{
    if (urlString.length > 0) {
        _urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    }
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:_urlString] placeholderImage:[UIImage imageNamed:@"f_placeholder_img"] options:SDWebImageRetryFailed];
}

@end
